package com.kingbook.services;
import com.kingbook.core.base.SupportService;
import com.kingbook.entity.Version;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author Bucky
 * @Date 2020-05-06 23:59:03
 * @Version 1.0
 */
@Slf4j
@Service
public class VersionService extends SupportService {

    @PostConstruct
    private void init() {
        setNamespace("Version");
    }

    public Version getLastVersion() {
        return findObject("query", null, Version.class);
    }

    public void addUpgradeTimes(int id) {
        Map<String, Object> param = new HashMap<>(1);
        param.put("id", id);
        update("addUpgradeTimes",param);
    }
}
